package com.galen.manual.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("products")
public class Product {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("name")
    private String name;

    @TableField("description")
    private String description;

    @TableField("image_urls")
    private String imageUrls; // 多个图片URL用逗号分隔

    @TableField("category_id")
    private Long categoryId;

    @TableField("unit_price")
    private BigDecimal unitPrice;

    @TableField("difficulty_level")
    private Integer difficultyLevel; // 1:简单 2:中等 3:困难

    @TableField("stock_quantity")
    private Integer stockQuantity; // 库存数量

    @TableField("warning_stock")
    private Integer warningStock; // 预警库存

    @TableField("status")
    private Integer status; // 0:下架 1:上架 2:售罄

    @TableField("view_count")
    private Integer viewCount; // 浏览次数

    @TableField("order_count")
    private Integer orderCount; // 被领取次数

    @TableField("completed_count")
    private Integer completedCount; // 完成次数

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    @TableField("deleted")
    private Integer deleted;

}